#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
class Point
{
public:
	int x;
	int y;
	Point(int _x=0, int _y=0)
	{
		x = _x;
		y = _y;
	}
	friend double multi_x(Point a, Point b)
	{
		return(a.x * b.y - a.y * b.x);
	}
	friend double distanced(Point a, Point b)
	{
		int x = a.x - b.x;
		int y = a.y - b.y;
		return (sqrt(x * x + y * y));
	}
	friend Point operator-(Point a, Point b)
	{
		return Point(a.x - b.x, a.y - b.y);
	}
	friend ostream& operator<<(ostream& os,Point& t)
	{
		os <<'('<< t.x <<',' << t.y << ')' << endl;
		return os;
	}
};

Point* _a;//װ�㼯������
int find_down(Point* t,int n)//�ҵ������½ǵĻ�׼��
{
	int j = 0;
	Point tmp;
	for (int i = 2; i < n; i++)
	{
		if (t[i].y < t[j].y|| t[i].y == t[j].y && t[i].x < t[j].x)	j = i;
	}
	return j;
}
double distanced(Point a, Point b);
bool comp(Point a, Point b)//����ıȽϹ��������������ıȽϣ�aΪ���㣬bΪ���������е�
{
	double x = multi_x(a - _a[0], b - _a[0]);
	if (x > 0) return true;
	if (x == 0 && distanced(a, _a[0]) < distanced(b, _a[0]))	return true;
	return false;
}
double mutli(Point a, Point b, Point c)
{
	return multi_x(b - a, c - a);
}

int main()
{
	Point solution[50];
	int n;
	cin >> n;
	_a = new Point[n];
	for (int i = 0; i < n; i++)
	{
		cin >> _a[i].x >> _a[i].y;
	}
	if (n > 3)
	{
		int down = find_down(_a, n);
		swap(_a[down], _a[0]);//�ѻ��������ǰ��
		sort(_a + 1, _a + n, comp);//���ÿ⺯�����Լ��Ǵ�С��������
		solution[0] = _a[0];
		solution[1] = _a[1];
		int t = 1;
		for (int i = 2; i < n; i++)
		{
			while (t >= 1 && mutli(solution[t - 1], solution[t], _a[i]) <= 0)	t--;
			solution[++t] = _a[i];
		}
		for (int i = 0;i<=t;i++)
		{
			cout << solution[i];
		}
	}
	else
	{
		for (int i = 0; i < n; i++)
		{
			cout << _a[i] << endl;
		}
	}
	return 0;
}